body {
    /* background: #f2f2f2; */
    background: #282c34;
}

.frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    margin-top: -200px;
    margin-left: -200px;
    border-radius: 2px;
    box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.3);
    background: #4b4841;
}

.card {
    position: absolute;
    width: 320px;
    height: 180px;
    top: 110px;
    left: 40px;
    perspective: 800px;

    &:hover .flip {
        transform: rotateX(180deg);
        box-shadow: 8px -10px 15px 0 rgba(0, 0, 0, 0.5);
    }

    .flip {
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
        perspective: 1000px;
        box-shadow: 8px 10px 15px 0 rgba(0, 0, 0, 0.5);
        transition: all 1s ease-in-out;
    }

    .front,
    .back {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        backface-visibility: hidden;
        border-radius: 3px;
        overflow: hidden;
        text-align: center;
        background: #ffce4e;
    }

    .front {
        z-index: 2;
        transform: rotateX(0);

        img {
            position: relative;
            top: 52px;
            animation: bike 0.6s ease-in-out infinite;
            transform-origin: 50% 100%;
        }

        .street {
            position: absolute;
            top: 127px;
            left: 80px;
            width: 160px;
            height: 3px;
            overflow: hidden;

            @for $i from 1 through 9 {
                .stripe-#{$i} {
                    position: absolute;
                    right: -25px;
                    top: 0;
                    height: 3px;
                    width: (2 + $i * 2) + px;
                    background: #4b4841;
                    border-radius: 3px;
                    animation: street
                        (0.8 + random(2) / 10) +
                        s
                        linear
                        (random(10) / 10) +
                        s
                        infinite;
                }
            }
        }
    }

    .back {
        transform: rotateX(180deg);

        img {
            position: relative;
            z-index: 1;
            top: 57px;
            animation: helicopter 1.5s ease-in-out infinite;
            animation-fill-mode: both;
        }

        .sky {
            position: absolute;
            top: 0;
            left: 80px;
            bottom: 0;
            width: 160px;
            overflow: hidden;

            @for $i from 1 through 9 {
                .cloud-#{$i} {
                    position: absolute;
                    right: -25px;
                    top: (20 + $i * 14) + px;
                    height: 3px;
                    width: (10 + random(150) / 10) + px;
                    background: #4b4841;
                    border-radius: 3px;
                    animation: cloud
                        (0.6 + random(2) / 10) +
                        s
                        linear
                        (random(10) / 10) +
                        s
                        infinite;
                }
            }
        }
    }
}

@keyframes bike {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

@keyframes helicopter {
    0%,
    100% {
        transform: translate3d(0, -5px, 0);
    }
    50% {
        transform: translate3d(0, 5px, 0);
    }
}

@keyframes street {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-210px, 0, 0) scale(0.8);
    }
}

@keyframes cloud {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(-210px, 0, 0) scale(0.8);
    }
}
